Ext.define('Usws.view.videoFile.VideoFile', {
    extend: 'Ext.grid.Panel',
    xtype: 'VideoFile-Grid',
    store: 'VideoFile',
    title: '视频文件信息',
    selType:'checkboxmodel',//设定选择模式  
    multiSelect:true,//运行多选  
    layout:'fit',
    initComponent: function () {
    	this.tbar = [
    	             {
						  xtype: 'panel',
	       	              border:false,
	       	              layout:'hbox',
	       	              items:[
	       	                  {xtype: 'button', text: '添加视频文件',  action: 'add',margin:'5 5 5 5'},
	       	                  {xtype: 'button', text: '批量删除',  action: 'deleteMore',margin:'5 5 5 5'}
	       	            	   ]
					  }
    	            ];
        this.columns = [
			 {text : '原始文件', width : '15%', sortable : true, dataIndex: 'origFileName', hidden: false}
			,{text : '预览图', width : '15%', sortable : true, dataIndex: 'videoSnapshotURL', hidden: false,
				renderer: function(value){
					  return "<img src='"+value+"' width='60' height='40'/>";
				  }	
			}
			,{text : '文件大小', width : '10%', sortable : true, dataIndex: 'fileSize', hidden: false,
			  renderer: function(value){
				  return value+"字节";
			  }
			}
			,{text : '文件类型', width : '15%', sortable : true, dataIndex: 'mimeType', hidden: false}
			,{text : '播放时长', width : '10%', sortable : true, dataIndex: 'disPlayLen', hidden: false}
			,{text : '扩展名', width : '5%', sortable : true, dataIndex: 'fileExt', hidden: true}
			,{text : '创建者', width : '10%', sortable : true, dataIndex: 'createUserName', hidden: false}
			,{text : '创建时间', width : '15%', sortable : true, dataIndex: 'createDate',renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s'), hidden: false}
            , {
	            text:'操作',
	            sortable: false,
	            xtype: 'actioncolumn',
	            margin:'5px',
	            align:'center',
	            width : '5%',
	            items: [{
	            	icon: '/ext4/resources/images/cog_edit.png',  // Use a URL in the icon config
	                tooltip: '编辑',
	                action: 'edit',
	                handler: function(grid,rowIndex,colIndex,item,e) {
	                	this.fireEvent('itemclick', this, grid, rowIndex, colIndex, item, e);
	                }
	            },'-',{
	                icon: '/ext4/resources/images/delete.gif',
	                tooltip: '删除',
	                action: 'delete',
	                handler: function(grid,rowIndex,colIndex,item,e) {
	                	this.fireEvent('itemclick', this, grid, rowIndex, colIndex, item, e);
	                }
	            }]
            }];
        this.bbar= {
            xtype: 'pagingtoolbar',
            store: 'VideoFile',
            pageSize: 16,
            displayInfo: true,
            firstText:'首页',
            prevText:'上一页',
            nextText:'下一页',
            beforePageText:'第',
            afterPageText:'共  {0} 页',
            displayMsg: '显示第 {0} 条到 {1} 条记录，一共 {2} 条', 
            emptyMsg: "没有记录",
            refreshText:'刷新',
            lastText:'未页'
        };
        this.callParent();
    }
});